summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-12-04 21:05:28 +0900
committerjoonhoekim <26rote@gmail.com>2025-12-04 21:05:28 +0900
commite5b36fa6a1b12446883f51fc5e7cd56d8df8d8f5 (patch)
treec8f9fb50eb593dd5322d26d9276947c155997858 /app/[lng]/evcp
parent240f4f31b3b6ff6a46436978fb988588a1972721 (diff)
parent04ed774ff60a83c00711d4e8615cb4122954dba5 (diff)
Merge branch 'jh-auth-menu' into dujinkim
Diffstat (limited to 'app/[lng]/evcp')
-rw-r--r--app/[lng]/evcp/(evcp)/(system)/menu-list/page.tsx79
-rw-r--r--app/[lng]/evcp/(evcp)/layout.tsx7
2 files changed, 16 insertions, 70 deletions
diff --git a/app/[lng]/evcp/(evcp)/(system)/menu-list/page.tsx b/app/[lng]/evcp/(evcp)/(system)/menu-list/page.tsx
index 2cff434e..79923397 100644
--- a/app/[lng]/evcp/(evcp)/(system)/menu-list/page.tsx
+++ b/app/[lng]/evcp/(evcp)/(system)/menu-list/page.tsx
@@ -1,75 +1,20 @@
-// app/evcp/menu-list/page.tsx
+import { MenuTreeManager } from "@/lib/menu-v2/components/menu-tree-manager";
-import { Suspense } from "react";
-import { Card, CardContent } from "@/components/ui/card";
-import { getActiveUsers, getMenuAssignments } from "@/lib/menu-list/servcie";
-import { InitializeButton } from "@/lib/menu-list/table/initialize-button";
-import { MenuListTable } from "@/lib/menu-list/table/menu-list-table";
-import { Shell } from "@/components/shell"
-import * as React from "react"
-import { InformationButton } from "@/components/information/information-button";
-import { useTranslation } from "@/i18n";
-interface MenuListPageProps {
- params: Promise<{ lng: string }>
+interface PageProps {
+ params: Promise<{ lng: string }>;
}
-export default async function MenuListPage({ params }: MenuListPageProps) {
- const { lng } = await params
- const { t } = await useTranslation(lng, 'menu')
+export default async function MenuV2Page({ params }: PageProps) {
+ const { lng } = await params;
- // 초기 데이터 로드
- const [menusResult, usersResult] = await Promise.all([
- getMenuAssignments(),
- getActiveUsers()
- ]);
-
- // 서버사이드에서 번역된 메뉴 데이터 생성
- const translatedMenus = menusResult.data?.map(menu => ({
- ...menu,
- sectionTitle: menu.sectionTitle || "",
- translatedMenuTitle: t(menu.menuTitle || ""),
- translatedSectionTitle: t(menu.sectionTitle || ""),
- translatedMenuGroup: menu.menuGroup ? t(menu.menuGroup) : null,
- translatedMenuDescription: menu.menuDescription ? t(menu.menuDescription) : null
- })) || [];
-
return (
- <Shell className="gap-2">
- <div className="flex items-center justify-between space-y-2">
- <div className="flex items-center justify-between space-y-2">
- <div>
- <div className="flex items-center gap-2">
- <h2 className="text-2xl font-bold tracking-tight">
- {t('menu.information_system.menu_list')}
- </h2>
- <InformationButton pagePath="evcp/menu-list" />
- </div>
- {/* <p className="text-muted-foreground">
- 각 메뉴별로 담당자를 지정하고 관리할 수 있습니다.
- </p> */}
- </div>
- </div>
-
+ <div className="container mx-auto py-6 space-y-6">
+ <div>
+ <h1 className="text-2xl font-bold tracking-tight">Menu Management</h1>
</div>
-
-
- <React.Suspense
- fallback={
- ""
- }
- >
- <Card>
- <CardContent className="pt-6">
- <Suspense fallback={<div className="text-center py-8">로딩 중...</div>}>
- <MenuListTable
- initialMenus={translatedMenus}
- initialUsers={usersResult.data || []}
- />
- </Suspense>
- </CardContent>
- </Card>
- </React.Suspense>
- </Shell>
-
+
+ <MenuTreeManager initialDomain="evcp" />
+ </div>
);
}
+
diff --git a/app/[lng]/evcp/(evcp)/layout.tsx b/app/[lng]/evcp/(evcp)/layout.tsx
index c5e75a4c..093d9301 100644
--- a/app/[lng]/evcp/(evcp)/layout.tsx
+++ b/app/[lng]/evcp/(evcp)/layout.tsx
@@ -1,5 +1,5 @@
import { ReactNode } from 'react';
-import { Header } from '@/components/layout/Header';
+import { HeaderV2 } from '@/components/layout/HeaderV2';
import { SiteFooter } from '@/components/layout/Footer';
import { getServerSession } from "next-auth";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
@@ -20,7 +20,8 @@ export default async function EvcpLayout({ children }: { children: ReactNode })
try {
const result = await verifyNonsapPermission(
parseInt(session.user.id),
- ['SEARCH']
+ // ['SEARCH']
+ [] // 아무런 실제 권한이 없어도, 등록된 상태라면 화면에 'SEARCH' 권한이 있는것처럼 동작하게 해달라고 함. (김희은 프로)
);
isAuthorized = result.authorized;
authMessage = result.message || "";
@@ -36,7 +37,7 @@ export default async function EvcpLayout({ children }: { children: ReactNode })
return (
<div className="relative flex min-h-svh flex-col bg-background">
{/* <div className="relative flex min-h-svh flex-col bg-slate-100 "> */}
- <Header />
+ <HeaderV2 />
{!skipPermissionCheck && (
<PermissionChecker authorized={isAuthorized} message={authMessage} />
)}